﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ASPNETVN.PORTAL.Components.UI
{
    public class AloneControl : UserControl
    {
        private readonly PlaceHolder _header = new PlaceHolder();
        private readonly PlaceHolder _footer = new PlaceHolder();
        private readonly PlaceHolder _headerPlaceHolder = new PlaceHolder();

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            // Create frame for module content.
            LiteralControl literalControl12345 = new LiteralControl();
            literalControl12345.Text = "<div class='ModuleContent'><table width='100%' cellpadding='0' cellspacing='0' border='0'><tr><td class='ModuleFrame1'></td><td class='ModuleFrame2'></td><td class='ModuleFrame3'></td></tr><tr><td class='ModuleFrame4'></td><td class='ModuleFrame5'>";

            LiteralControl literalControl6789 = new LiteralControl();
            literalControl6789.Text = "</td><td class='ModuleFrame6'></td></tr><tr><td class='ModuleFrame7'></td><td class='ModuleFrame8'></td><td class='ModuleFrame9'></td></tr></table></div>";

            _header.Controls.Add(literalControl12345);
            _footer.Controls.Add(literalControl6789);

            this._headerPlaceHolder.Controls.Add(_header);
            this.Controls.Add(_footer);
        }

        protected override void OnInit(EventArgs e)
        {
            this.Controls.AddAt(0, _headerPlaceHolder);
            base.OnInit(e);
        }
    }
}
